package com.wyiot.pet.model.dto;

import com.wyiot.core.api.ValidateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 修改地址或新增地址 数据传输对象
 *
 * @author yly
 * @since 2022年03月24日
 */

@Data
public class AddressDTO {

    /**
     * 地址Id
     */
    @NotNull(message = "请输入地址id", groups = {ValidateGroup.First.class})
    private Long addressId;

    /**
     * 寄件地址用户名
     */
    @NotBlank(message = "请输入收件人名称", groups = {ValidateGroup.First.class, ValidateGroup.Second.class})
    private String addressUserName;

    /**
     * 地址用户联系电话
     */
    @NotBlank(message = "请输入联系电话", groups = {ValidateGroup.First.class, ValidateGroup.Second.class})
    @Pattern(regexp = "^(?:(?:\\+|00)86)?1(?:(?:3[\\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\\d])|(?:9[189]))\\d{8}$",
            message = "请输入正确的手机号", groups = {ValidateGroup.First.class, ValidateGroup.Second.class})
    private String addressPhoneNumber;

    /**
     * 寄件地址城市
     */
    @NotBlank(message = "请输入寄件城市", groups = {ValidateGroup.First.class, ValidateGroup.Second.class})
    private String addressCity;

    /**
     * 寄件地址详情
     */
    @NotBlank(message = "请输入寄件详情地址", groups = {ValidateGroup.First.class, ValidateGroup.Second.class})
    private String addressDetail;

    /**
     * 是否为默认地址
     */
    private boolean addressIsdefault;


}
